/*
 * @Author: y001554
 * @Date: 2023-01-16 20:11:08
 * @LastEditors: y001554
 * @LastEditTime: 2023-02-06 17:44:43
 * @FilePath: \ylwl\packages\plugins\components\tree\src\tree-types.ts
 * @Description:
 *
 * Copyright (c) 2023 by FE/ylwl, All Rights Reserved.
 */
import type { PropType, ExtractPropTypes } from 'vue'

export interface TreeItem {
  label: string
  value?: string
  children?: TreeData
  disableToggle?: boolean
  disabled?: boolean
  pids?: Array<string>
  [key: string]: any
}

export interface CustomerProps {
  color?: string //主题色
  keyName?: string
}

export type TreeData = Array<TreeItem>
export type TypeModelValue = Array<string | number>

export const treeProps = {
  data: {
    type: Array as PropType<TreeData>,
    default: () => []
  },
  // 新增
  checkable: {
    type: Boolean,
    default: false
  },
  prop: {
    type: Object as PropType<CustomerProps>,
    default: () => ({})
  },

  modelValue: {
    type: Array<string | number>,
    default: () => []
  }
} as const

export type TreeProps = ExtractPropTypes<typeof treeProps>
